<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <title>ms-on-*</title>
        <!-[if IE 6.0]><script src="json3.js" type="text/javascript"></script><![endif]->
        <script src="avalon.js" type="text/javascript"></script>
        <script>
            var model = avalon.define("on", function(vm) {
                vm.firstName = "司徒"
                vm.array = ["aaa", "bbb", "ccc"]
                vm.argsClick = function(e, a, b) {
                    alert(a + "  " + b)
                }
                vm.loopClick = function(a) {
                    alert(a)
                }
                vm.submit = function() {
                    var data = model.$model
                    setTimeout(function() {
                        alert(JSON.stringify(data))
                    })
                }
            });

        </script>
    </head>
    <body>
        <h3 style="text-align: center">ms-on-*</h3>
        <fieldset ms-controller="on">
            <legend>有关事件回调传参</legend>
            <div ms-click="argsClick($event, 100, firstName)">点我</div>
            <div ms-each-el="array" >
                <p ms-click="loopClick(el)">{{el}}</p>
            </div>
            <button ms-click="submit">点我</button>
        </fieldset>
    </body>
</html>